package com.kuangstudy;

import com.kuangstudy.domain.User;
import com.kuangstudy.service.UserService;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * @author panghu
 * @version 1.0.0
 * @createTime 2022年08月12日 22:58:00
 * @Description
 */
public class APPConsumer {

    public static void main(String[] args) throws Exception {
        ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[]{"classpath:consumer.xml"});
        context.start();
        UserService userService = (UserService) context.getBean("userService"); // 获取远程服务代理
        User user = userService.getUserByUserId(1000L);
        System.out.println(user); // 显示调用结果

        System.in.read(); // 按任意键退出
    }
}
